package com.sysd.exception;

import com.sysd.entity.CodeMsg;
import lombok.ToString;

/**
 * @description:
 * @author: bsh
 * @date: 2025/5/30 10:56
 */
@ToString
public class ServiceException extends AbstractException {
    public ServiceException(int code, String msg, Throwable cause) {
        super(code, msg, cause);
    }

    public ServiceException(int code, String msg) {
        this(code, msg, new Throwable(msg));
    }

    public ServiceException(String msg) {
        this(-1, msg,   new Throwable(msg));
    }

    public ServiceException(CodeMsg cm) {
        this(cm.getCode(), cm.getMsg());
    }

    public ServiceException(CodeMsg cm, String extendMsg) {
        this(cm.getCode(), cm.getMsg() + extendMsg);
    }
}
